package com.xiaohudie.SGGio;

import java.io.*;

/**
 * @Author xiao hu die
 * @Date 2022/3/25 15:38
 * @Version 1.0
 */
/**更改System.out的输出位置
 * 使用System.setOut()*/
public class SystemOutTest {
    public static void main(String[] args) throws FileNotFoundException {
test01();
    }
    public static void test01() throws FileNotFoundException {
        FileOutputStream fileOutputStream = new FileOutputStream(new File("D:\\java图片代码\\1212.txt"));
        /**开启自动刷新*/
        PrintStream printStream =new PrintStream(fileOutputStream,false);
        if (printStream!=null){
        System.setOut(printStream);
        }
        for (int i = 0; i <255 ; i++) {
            System.out.print((char)i);
         if (i % 50 == 0){
             System.out.println();
         }
        }
        printStream.close();
    }
}
